package com.deworks.admin.common.utils;

import java.util.Base64;

public class Base64Util {
    public static String encode(byte[] bytes) {
        return Base64.getEncoder().encodeToString(bytes);
    }

    public static String encodeStr(String src) {
        return Base64.getEncoder().encodeToString(src.getBytes());
    }

    public static byte[] decode(String base64) {
        return Base64.getDecoder().decode(base64);
    }

    public static String decodeStr(String base64) {
        return new String(Base64.getDecoder().decode(base64));
    }
}
